<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>vue.js</title>
	<script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
	<div id="app">
		<button v-on:click="click">Click</button>
	</div>
	<script type="text/javascript">
		var vm = new Vue({
			el: '#app',
			data: {
				name: 'vue.js'
			},
			//在'methods'对象中定义方法
			methods: {
				click: function (event) {
					// 'this'在方法里指当前Vue实例
					alert('Hello ' + this.name + '!')
					// 'event'是原生Dom事件
					if (event) {
						alert(event.target.tagName)
					}
				}
			}
		})
		vm.click()
	</script>
</body>
</html>
